package cn.lisens.exception;


import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.http.ResponseEntity;

@ControllerAdvice
public class ControllerException {

    @ExceptionHandler(Exception.class)
    public ResponseEntity<String> handleException(Exception e) {
        String mess
                = "系统异常：" + e.getMessage();
        System.out.println(mess);
        e.getMessage();

        return ResponseEntity.status(500).body("系统异常：" + e.getMessage());
    }
}

